﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using tracker.Models.Entities;

namespace tracker.Models.DAL
{
    public class ImageListDAL:ErpCatalogueBaseBL
    { 
        #region Properties Define
        private string FIELD_STATUS = "Status";
        #endregion

        #region STORE NAME
        public const string IMAGELIST_SELECTBYSTATUS = "ImageList_SelectByStatus";
        #endregion

        public List<EImageList> getAllListImage(int status)
        {
            DataSet ds = ErpCatalogueBaseBL.SelectAllWithParameter(IMAGELIST_SELECTBYSTATUS,
                                                                   new string[] { FIELD_STATUS },
                                                                   new object[] { status });
            List<EImageList> list = null;
            if (Utilities.hasRow(ds))
            {
                list = new List<EImageList>();
                DataTable dt = ds.Tables[0];
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    EImageList img = EImageList.create(dt.Rows[i]);
                    list.Add(img);
                }
            }
            return list; 
        }

    }
}